//
//  ZZCAuthorDescriptionCollectionViewCell.m
//  B段项目
//
//  Created by dllo on 15/12/22.
//  Copyright © 2015年 张智超. All rights reserved.
//

#import "ZZCAuthorDescriptionCollectionViewCell.h"

@implementation ZZCAuthorDescriptionCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
    
}

-(void)createSubViews{
    
    self.musicImage = [[UIImageView alloc] init];
    self.musicImage.image = [UIImage imageNamed:@"兔子2.png"];
    [self.contentView addSubview:self.musicImage];
    [self.musicImage mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.edges.equalTo(self.contentView);
        
    }];
    UIImageView *image = [[UIImageView alloc] initWithFrame:self.contentView.bounds];
    image.image = [UIImage imageNamed:@"jianbian.jpg"];
    image.alpha = 0.5;
    [self.musicImage addSubview:image];
    
    
    self.title = [[UILabel alloc] init];
    self.title.font = [UIFont systemFontOfSize:self.contentView.frame.size.height / 7];
    self.title.textColor = [UIColor whiteColor];
    [self.contentView addSubview:self.title];
    
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.mas_equalTo(0);
        make.bottom.equalTo(self.contentView.mas_bottom);
        make.width.equalTo(self.contentView.mas_width);
        make.height.equalTo(self.contentView.mas_height).multipliedBy(0.14);
    }];
    
}

-(void)setAuthorDic:(NSMutableDictionary *)authorDic{
    _authorDic = authorDic;
    
    self.title.text = [[authorDic objectForKey:@"playInfo"] objectForKey:@"title"];
    NSURL *url = [NSURL URLWithString:[[authorDic objectForKey:@"playInfo"] objectForKey:@"imgUrl"]];
    [self.musicImage sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"zhanwei.jpg"]];
}

@end
